import request from '@/utils/request'

// 查询房屋管理列表
export function listRoomManage(query) {
  return request({
    url: '/property-management/roomManage/list',
    method: 'get',
    params: query
  })
}

// 查询房屋管理详细
export function getRoomManage(id) {
  return request({
    url: '/property-management/roomManage/' + id,
    method: 'get'
  })
}

// 新增房屋管理
export function addRoomManage(data) {
  return request({
    url: '/property-management/roomManage',
    method: 'post',
    data: data
  })
}

// 修改房屋管理
export function updateRoomManage(data) {
  return request({
    url: '/property-management/roomManage',
    method: 'put',
    data: data
  })
}

// 删除房屋管理
export function delRoomManage(ids) {
  return request({
    url: '/property-management/roomManage/' + ids,
    method: 'delete'
  })
}

// 绑定房屋
export function bindRoomManage(roomId) {
  return request({
    url: '/property-management/roomManage/bind/' + roomId,
    method: 'put'
  })
}

// 根据楼宇ID获取未绑定的房屋列表
export function getUnbindRoomsByBuildingId(buildingId) {
  return request({
    url: '/property-management/roomManage/getUnbindRoomsByBuildingId/' + buildingId,
    method: 'get'
  })
}

// 根据楼宇ID获取其中绑定状态为1的房屋ID列表
export function getRoomIdsByBuildingIdAndBindStatus(buildingId) {
  return request({
    url: '/property-management/roomManage/getRoomIdsByBuildingIdAndBindStatus/' + buildingId,
    method: 'get'
  })
}
// 根据房间ID获取房间号
export function getRoomNoById(id) {
  return request({
    url: '/property-management/roomManage/no/' + id,
    method: 'get'
  })
}